package com.yanqu.road.server.manager.banquet;

import com.yanqu.road.entity.banquet.cross.CrossBanquetData;
import com.yanqu.road.utils.executor.GeneralTask;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
 * 自动回宴异步线程逻辑处理器
 */
public class AutoJoinBanquetBackThreadTask extends GeneralTask {

    private CrossBanquetData userBanquetData;
    private long userId;
    private int giftId;
    private long endTime;
    private int acId;


    public AutoJoinBanquetBackThreadTask(CrossBanquetData userBanquetData, long userId, int giftId, long endTime, int acId) {
        this.userBanquetData = userBanquetData;
        this.userId = userId;
        this.giftId = giftId;
        this.endTime = endTime;
        this.acId = acId;
    }

    @Override
    public void doRun() {
        try{
            //自动回宴
            CrossBanquetMgr.joinAutoBack(this.userBanquetData, userId, giftId, endTime, acId);
        }catch (Exception e){
            getLOGGER().error("autoJoinBanquet error:",e);
        }
    }
}
